using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

/**
*@file       GBServer_NotifySender.cs
*@brief      send message GBServer_Notify
*
*@author     graywind
*@version    1.0.0.1
*@data       2012/3/16
*/

//send message GBServer_Notify
public class msgGBServer_Notify
{
    public const int MessageId = (int)GlobalTypes.MessageType.GBServer_Notify;
    //TODO
	public int SessionId = NetLib.INVALID_SESSION;
	public global.ServerNotify MsgContent = new global.ServerNotify();
	/// <summary>
	/// Initializes a new instance of the <see cref="msgGBServer_Notify"/> class.
	/// </summary>
	/// <param name='session_id'>
	/// Session_id.
	/// </param>
	/// <param name='server_type'>
	/// Server_type.
	/// </param>
	public msgGBServer_Notify(int session_id, global.eServerType server_type)
	{
		SessionId = session_id;
		MsgContent.ServerType = server_type;
	}
}

//handle message
public partial class gwMessagePort
{
    /// <summary>
    /// handle message
    /// </summary>
    /// <param name="msg">message wrapper of GBServer_Notify</param>
    public static void ProcessMessage(msgGBServer_Notify msg)
    {
        //TODO
		msgGlobal mainMsg = new msgGlobal(msg.SessionId, msgGBServer_Notify.MessageId, ProtoNet<global.ServerNotify>.IntoBytes(msg.MsgContent));
		gwMessagePort.ProcessMessage(mainMsg);
    }
}
